import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        int n = scan.nextInt();
        int q = scan.nextInt();
        long[] arr = new long[n + 1];
        long[] diff = new long[n + 1];
        for (int i = 0; i < n; i++) {
            arr[i] = scan.nextInt();
        }
        for (int i = 0; i < q; i++) {
            int l = scan.nextInt() - 1;
            int r = scan.nextInt() - 1;
            int d = scan.nextInt();
            diff[l] += d;
            diff[r + 1] -= d;
        }

        for (int i = 1; i < n; i++) {
            diff[i] += diff[i - 1];
        }

        for (int i = 0; i < n; i++) {
            long x = arr[i] + diff[i];
            if (x > 0) {
                System.out.print(x + " ");
            } else {
                System.out.print(0 + " ");
            }
        }
        scan.close();
    }
}
